<?php
namespace app\admin\logic;
class CreateSwaggerJsonLogic extends ApiBase{
    public static function index(){
        $path = '../app/admin/doc';
        $openapi = \OpenApi\scan($path);
        header('Content-Type: application/json');
        $json_result = json_encode($openapi, true);
        $swagger_json_path = './docs/admin/doc.json';
        file_put_contents($swagger_json_path, $json_result);
        return returnData(false);
    }
}